package com.tuni.birthdaymoney.persistence.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;

import com.tuni.birthdaymoney.persistence.entity.Department;
import com.tuni.birthdaymoney.persistence.entity.Person;
import com.tuni.birthdaymoney.persistence.entity.Position;

public interface PersonRepository extends JpaRepository<Person, Integer>, QueryDslPredicateExecutor<Person> {

    public Person findByEmail(String email);

    public Person findByAuthToken(String authToken);

    // public List<Person> findByBirthdayBetween(Date left, Date right);

    public List<Person> findByLastName(String lastName);

    public List<Person> findByFirstName(String firstName);

    public List<Person> findByDepartment(Department department);

    public List<Person> findByPosition(Position position);

    public List<Person> findByFirstNameAndLastName(String firstName, String lastName);

}